package com.itaomiao.filter.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * Application Lifecycle Listener implementation class SessionListener
 *
 */
@WebListener
public class SessionListener implements HttpSessionListener {

    /**
     * Default constructor. 
     */
    public SessionListener() {
        // TODO Auto-generated constructor stub
    }

	/**
     * @see HttpSessionListener#sessionCreated(HttpSessionEvent)
     */
    public void sessionCreated(HttpSessionEvent evnet)  { 
        System.out.println("session创建:"+evnet.getSession().getId());
         // TODO Auto-generated method stub
    }

      
        /* (非 Javadoc)  
        *   
        *   
        * @param arg0  
        * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)  
        */  
        
    @Override
    public void sessionDestroyed(HttpSessionEvent evnet) {
        System.out.println("session销毁:"+evnet.getSession().getId());
    }

	
	
}
